package net.bac.sbe.common.http;

import java.io.IOException;
import java.io.InputStream;

import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.DefaultHttpClient;

public final class SonarHTTPClientWrapper {
	
	private SonarHTTPClientWrapper(){
		super();
	}
    
    public static InputStream httpGetCall(String url) throws IOException{
    	DefaultHttpClient httpclient = new DefaultHttpClient();
    	HttpGet httpGet = new HttpGet(url);
        HttpResponse response1 = httpclient.execute(httpGet);
        HttpEntity entity1 = null;
        try {
            entity1 = response1.getEntity();
        } finally {
            httpGet.releaseConnection();
        }
        return (null != entity1)?entity1.getContent():null;
    }

}
